<template>
	<view>
		<view>
			<view class="leaveNav">
				<view style="font-weight: 800;font-size: 39rpx;">巡查情况
					<view class="violationLine"></view>
				</view>
			</view>
			<view class="displayStudentInfo">
				<view style="color:#8F8F94;margin-bottom:20rpx;">
					宿舍：{{item.patrol.dormitoryNo}}
				</view>
				<view style="color:#8F8F94;margin-bottom:20rpx;">
					宿舍楼：{{item.patrol.buildingNo}}
				</view>
				<view style="color:#8F8F94;margin-bottom: 20rpx;">卫生情况：{{item.patrol.hygienicStatus | healthSlec}}
				</view>
				<view style="color:#8F8F94;margin-bottom:20rpx;">
					整体评价：{{item.patrol.describeTxt}}
				</view>
				
				<view style="color: black;margin-bottom: 20rpx;color:#8F8F94;">
					巡查情况登记人：{{item.patrol.createBy}}
				</view>
				
				<view v-if="item.patrol.patrolImg" style="margin-bottom: 20rpx;">
					<img :src="img2" class="imgSty" mode=""></img>
				</view>

				<view class="leaveNav1">
					<view style="font-weight: 800;font-size: 39rpx;">处理情况
						<view class="violationLine"></view>
					</view>
				</view>
				<view style="color:#8F8F94;margin-bottom: 20rpx;">
					处理结果：{{item.handle.handleInfo}}
				</view>
				<view style="color:#8F8F94;margin-bottom: 20rpx;">
					处理时间：{{item.handle.handleDate}}
				</view>
				<view style="color:#8F8F94;margin-bottom: 20rpx;">
					处理人：{{item.handle.actualHandler}}
				</view>
				<view v-if="item.handle.handleImg">
					<img :src="img" class="imgSty" mode=""></img>
				</view>
			</view>
		</view>
		<!-- <my-bottom :topName="topName"></my-bottom> -->
	</view>
</template>

<script>
	import {
		pathToBase64,
		base64ToPath
	} from '../../utils/index.js'
	import topCom from '../component/topCom.vue'
	import bottomCom from '../component/bottom.vue'
	import headTitle from '../component/btnHeadeCom.vue'
	import * as imageConversion from 'image-conversion'
	export default {
		data() {
			return {
				img: '',
				img2: '',
				userName: '',
				topName: '宿舍巡查',
				id: '',
				time: false,
				item: '',
				actualHandler: "",
				patrolId: 0,
				arr: {},
				imgShow: '',
			}
		},
		onShow() {
			var that = this
			uni.getStorage({
				key: "loginName",
				success: (res) => {
					that.userName = res.data
				}
			})

			this.actualHandler = uni.getStorageSync("loginName");
		},
		onLoad(options) {
			var that = this
			var obj = JSON.parse(options.obj);
			console.log(obj);
			this.item = obj;
			if (obj.handle.handleImg) {
				this.img = ` ${that.$baseAppUrl}common/downloadFileImg?filename=${obj.handle.handleImg}`
			} else {
				this.item.handle.handleImg = null
			}
			if (obj.patrol.patrolImg) {
				this.img2 = ` ${that.$baseAppUrl}common/downloadFileImg?filename=${obj.patrol.patrolImg}`
			} else {
				this.item.patrol.patrolImg = null
			}
			this.arr = JSON.parse(this.item.patrol.classPatrolJson)
		},
		components: {
			topCom,
			bottomCom,
			headTitle
		},
		methods: {},
		filters: {
			healthSlec(index) {
				if (index == 1) {
					return "优秀"
				} else if (index == 2) {
					return "良好"
				} else {
					return "差"
				}
			},
			healthSlec2(index) {
				if (index == 1) {
					return "优秀"
				} else if (index == 2) {
					return "良好"
				} else {
					return "差"
				}
			},
			showDvtype(type) {
				// 巡查违纪类型 1：迟到 2：未戴校牌 3：未穿校服 4：其他 5：校园抽烟 6：打架斗殴 7：携带外卖  8：打牌赌博 9：翻爬围墙 10 谩骂他人 11：携带违禁品
				if (type == "7") {
					return "迟到"
				} else if (type == "8") {
					return "未戴校牌"
				} else if (type == "9") {
					return "未穿校服"
				} else if (type == "6") {
					return "其他"
				} else if (type == "11") {
					return "校园抽烟"
				} else if (type == "12") {
					return "打架斗殴"
				} else if (type == "10") {
					return "携带外卖"
				} else if (type == "14") {
					return "打牌赌博"
				} else if (type == "15") {
					return "翻爬围墙"
				} else if (type == "16") {
					return "谩骂他人"
				} else if (type == "17") {
					return "携带违禁品"
				} else if (type == "13") {
					return "饮酒酗酒"
				}
			}
		},
	}
</script>

<style>
	.content {
		display: flex;
		flex-direction: column;
		align-items: center;
		justify-content: center;
	}

	.violationLine {
		width: 200upx;
		height: 8upx;
		background: rgba(239, 220, 11, 1.0);
		opacity: 0.78;
		position: relative;
		bottom: -10rpx;
		left: -30upx;
	}

	.dormitoryNav {
		color: #0000FF;
		margin-left: 80rpx;
		margin-top: 30rpx;


	}

	.leaveNav {
		display: flex;
		justify-content: center;
		align-items: center;
		flex-direction: row;
		font-size: 36upx;
		color: blue;
		width: 20%;
		padding: 50rpx 100rpx;
		margin-bottom: -50rpx;
	}

	.leaveNav1 {
		display: flex;
		justify-content: center;
		align-items: center;
		flex-direction: row;
		font-size: 36upx;
		color: blue;
		width: 30%;
		padding: 10rpx 100rpx 40rpx 20rpx;
	}

	.displayStudentInfo {
		position: relative;
		top: 50rpx;
		left: 50rpx;

	}

	.repText {
		/* border: solid 1upx #999999; */
		border-radius: 20upx;
		width: 610rpx;
		height: 150upx;
		word-wrap: break-word;
		padding: 5px;
		/* margin-left:-10rpx; */
	}

	.repText2 {
		border: solid 1upx #999999;
		border-radius: 20upx;
		width: 580rpx;
		height: 300upx;
		word-wrap: break-word;
		padding: 5px;
		margin-top: 20rpx;
		/* margin-left:-10rpx; */
	}

	.attendanceLine {
		width: 600rpx;
		height: 2rpx;
		background-color: #8F8F94;
	}

	.repDevice {
		text-align: left;
		font-size: 36rpx;
		color: #808080;
		padding-left: 0rpx;
	}

	.imgSty {
		border: solid 1upx #999999;
		border-radius: 20upx;
		width: 580rpx;
		height: 300upx;
		margin: auto;
		padding: 10upx;
		margin-left: 0rpx;
		margin-top: 0rpx
	}

	.leaveBtn {
		background-image: url(https://tj-1305380059.cos.ap-nanjing.myqcloud.com/pic/tubiao-01.png);
		background-size: 100%;
		width: 220upx;
		height: 70upx;
		color: white;
		font-size: 32rpx;
		font-weight: 0;
		line-height: 70rpx;
	}
	.indexContent{
		height: 100vh;
	}
</style>
